package com.springboot.service.task;

import com.springboot.service.anno.DiyScheduled;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component(TestTask2.BEAN_NAME)
@DiyScheduled()
public class TestTask2 {
    final static String BEAN_NAME = "testTask2";

    //    @Scheduled(fixedRate = 5 * 60 * 1000)
    @DiyScheduled(cron = "0/10 * * * * ?", taskCode = "十秒执行一次")
    private void test() {

        System.out.println("十秒定时器开始执行" + System.currentTimeMillis());
    }

    @DiyScheduled(cron = "0/15 * * * * ?", taskCode = "十五秒执行一次")
    private void test2() {

        System.out.println("十五秒定时器开始执行" + System.currentTimeMillis());
    }

}
